<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>layout 微信菜单设置 - Layui</title>
<link rel="stylesheet" href="/layui-v2.0.1/layui/css/layui.css">
<link rel="stylesheet" href="/css/admin.css">

</head>
<body>

<div class="layui-layout layui-layout-admin">
       @include('admin.header')
  <div class="layui-side layui-bg-black">
    <div class="layui-side-scroll">
      <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
       @include('admin.leftadmin')
    </div>
  </div>
  
  <div class="layui-body">
    <!-- 内容主体区域 -->
      <table id="demo"></table>
      <script type="text/html" id="titleTpl">
        <a href="changebutton?id={{d.id}}" class="layui-table-link">修改&nbsp&nbsp&nbsp</a> 
        <a href="addsubbutton?id={{d.id}}" class="layui-table-link">添加子菜单&nbsp&nbsp&nbsp</a>
        <a href="dele?id={{d.id}}" class="layui-table-link">删除&nbsp&nbsp&nbsp</a>
      </script>
      <div style="margin-left: 30px">
          <button class="layui-btn">同步菜单</button>
      </div>
  </div>
  <div class="layui-footer">
    <!-- 底部固定区域 -->
    © layui.com - 底部固定区域
  </div>
</div>
<script src="/layui-v2.0.1/layui/layui.js"></script>
<script>
  layui.use(['element','form','jquery','table','layer'], function(){
    var element = layui.element;
    var form = layui.form;
    var table = layui.table;
    var $ = layui.jquery;
    var layer = layui.layer;
    table.render({
      url: 'getbuttondata'
      ,elem: '#demo' //指定原始表格元素选择器（推荐id选择器）
      ,height: 580 //容器高度
      ,cols: [[ //标题栏
          {checkbox: true}
          ,{field: 'id', sort:true, title: 'ID', width: 80}
          ,{field: 'button_level', title: '菜单等级', width: 220}
          ,{field: 'button_name', title: '名称', width: 220}
          ,{field: 'button_pater', title: '父级菜单', width: 220}
          ,{field: 'button_type', title: '菜单类型', width: 220}
          ,{field: 'button_url', title: 'url地址', width: 220}
          ,{field: 'username', title: '操作',templet: '#titleTpl', width:320}
        ]]
 //设置表头
      //,…… //更多参数参考右侧目录：基本参数选项
    });


    $(function(){
      $('.layui-btn').click(function(){
        $.ajax({
        url:"synchro",
        type:'post',
        // data:{'username':username,'password':password,'ad':ad},
        dataType:'html',
        success:function(d){
          layer.msg(d);
        }
       })
      })
    })

  });





</script>











